<script setup lang="ts">
  const runtimeConfig = useRuntimeConfig();
  const base_url = runtimeConfig.public.apiBase
  const HOST_ENV = runtimeConfig.public.HOST_ENV
  console.log('base_url', base_url)
  console.log('HOST_ENV', HOST_ENV)
  interface Self_Authorization {
    Authorization: String
  }
  const getList = () => {
    $fetch(`${base_url}/api/wnHistoryRecord`, {
      body: {
        name: 'wangli',
      },
      method: 'post',
      onRequest({request, options}) {
        // 设置请求头
        options.headers.append('Authorization', '1221212')
      },
    }).then(res => {
      console.log('_res', res)
    }).catch(e => {
      console.log('_e', e)
    })
  }
</script>

<template>
  <div class="setup-container">
    <el-button type="primary" @click="getList">请求</el-button>
  </div>
</template>

<style scoped lang="scss">
.setup-container{
  display: block;
}
</style>
